import com.sun.org.apache.bcel.internal.generic.SWITCH;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-11-07
 * Time:19:51
 */
public enum Enum {
    RED,GREEN,BLUE;

    public static void main(String[] args) {
        Enum enumA=RED;
        switch (enumA){
            case RED:
                break;
            case GREEN:
                break;
            case BLUE:
                break;
        }
        Enum []enums=Enum.values();
        for (int i = 0; i < enums.length; i++) {
            System.out.println(enums[i]+":"+enums[i].ordinal());
        }
        System.out.println(Enum.valueOf("GREEN"));
    }
}
